package action_行为型.null_object_pattern_空对象模式;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: hihi
 * @Date: 2020/07/09/17:55
 * @Description:
 */
public class CustomerFactory {

	public static final String[] names = { "zhangsan", "lisi", "wangwu", "fengliu", "ssss" };

	public static AbstractCustomer getCustomer(String name) {

		for (String s : names) {
			if (s.equalsIgnoreCase(name)) {
				return new RealCustomer(s);
			}
		}

		return new NullCustomer();
	}
}
